﻿@page "/add"
@using System.Text.RegularExpressions
@using System.ComponentModel.DataAnnotations


 <MForm @ref="_form">
  <MCard>
    <MTabs Color="deep-purple accent-4" Right>
        <MTab>基础</MTab>
        <MTab>高级</MTab>
        <MTabItem>
            <MContainer Fluid>
                <MRow>
                        <MCol Cols="12" Md="12">
                        <MTextField TValue="string" Label="书籍目录" Hint="输入书籍列表/目录页面的地址" ></MTextField>
                    </MCol>
  
                    <MCol Cols="6" Md="6">
                        <MTextField TValue="string" Label="开始章节" Hint="书籍开始章节的名称" ></MTextField>
                    </MCol>
                    <MCol Cols="6" Md="6">
                        <MTextField TValue="string" Label="结束章节" Hint="书籍结束章节的名称" ></MTextField>
                    </MCol>
       
                    <MCol Cols="12" Md="12">
                        <MSlider @bind-Value="Val"
                 TickLabels="_ticksLabels"
                 Max="900"
                 Min="100"
                 Step="200"
                 Ticks="@("always")"
                 TickSize="4"
                        AppendIcon="mdi-alarm"></MSlider>
                            @*<MSlider TValue="double" @bind-Value="Val" ThumbLabel="@("always")"  TickSize="4"  TickLabels="_ticksLabels" Min="100" Max="1000" Step="200" AppendIcon="mdi-alarm"></MSlider>*@
                    </MCol>
                </MRow>
            </MContainer>
        </MTabItem>
            <MTabItem>
            <MContainer Fluid>
                高级设置的内容
            </MContainer>
        </MTabItem>
    </MTabs>
    <MButton Color="success" Class="mr-4">立即开爬</MButton>
    <MButton Color="error" Class="mr-4">增加到爬书任务</MButton>
</MCard>
</MForm>


 





@*
<MudGrid>
    <MudItem xs="12" sm="12">
        <MudPaper Class="pa-4">
            <MudForm @ref="form" @bind-IsValid="@success" @bind-Errors="@errors">
                <MudTabs Elevation="4" Rounded="true" Centered="false" Color="@Color.Default">
                    <MudTabPanel Text="基础" Icon="@Icons.Material.Filled.Build">
                         <MudGrid>
                            <MudItem xs="12" md="12">
                                <MudTextField T="string" Label="书籍主页地址:" HelperText="输入书籍列表/目录页面的地址" Required="true" RequiredError="书籍目录地址没有填写!"
                                                Validation="@(new UrlAttribute() {ErrorMessage = "地址不正确"})" />
                            </MudItem>
                            <MudItem xs="6" md="6" lg="4">
                                <MudTextField T="string" Label="开始章节:" HelperText="书籍开始章节的名称" Required="true" RequiredError="开始章节没有填写!" />
                            </MudItem>
                            <MudItem xs="6" md="6" lg="4">
                                <MudTextField T="string" Label="结束章节:" HelperText="书籍结束章节的名称" Required="true" RequiredError="结束章节没有填写!" />
                            </MudItem>
                            <MudItem xs="6" md="6" lg="4">
                                <MudTextField T="int" Label="间隔速度:"  HelperText="默认为200毫秒,建议最少为50ms,以免被防火墙阻止"  Required="true" RequiredError="间隔速度没有填写!" />
                            </MudItem>
                        </MudGrid>
                    </MudTabPanel>
                    <MudTabPanel Text="高级" Icon="@Icons.Material.Filled.BugReport">
                        高级设置
                    </MudTabPanel>

                </MudTabs>
            </MudForm>
        </MudPaper>
        <MudPaper Class="pa-4 mt-4">
            <MudButton Variant="Variant.Filled" Color="Color.Primary" DisableElevation="true" >立即开爬</MudButton>
            <MudButton Variant="Variant.Filled" Color="Color.Secondary" DisableElevation="true" Class="mx-2">增加到爬书任务</MudButton>

        </MudPaper>
    </MudItem>
</MudGrid>
*@

@code {

    private List<string> _ticksLabels = new List<string> { "很快", "快", "适中","慢","很慢" };
    bool success;
    string[] errors = { };
    public double Val  = 500;
    MForm _form;

   

}